
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<table width="100%" border="0"  align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td rowspan="3" class="Text_12_black">
		 <div align="left"><span> &nbsp;&nbsp;&nbsp;: :<a href="<?php echo $this->webroot;?>admin/" class="Link_Title_12_black">Trang chính</a></span> <span >&gt;&gt; </span><a href="<?php echo $this->webroot;?>admin/plans/"class="Link_Text_12_black" >Danh sách dự án</a></div>
         <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tbody>
       <tr>
          <td width="12"><img src="<?php echo $this->webroot;?>img/CM1_01.gif" height="11" width="12" /></td>
          <td colspan="2" background="<?php echo $this->webroot;?>img/CM1_02.gif"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="11" width="12" /></td>
          <td width="11"><img src="<?php echo $this->webroot;?>img/CM1_03.gif" height="11" width="11" /></td>
        </tr>
        <tr>
          <td width="12" height="30" background="<?php echo $this->webroot;?>img/CM1_08.gif"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="10" width="12" /></td>
          <td height="30" colspan="2" align="center" bgcolor="#E2E2E2"><span class="Title_14_Red">Danh sách hình ảnh của dự án</span></td>
          <td valign="top" background="<?php echo $this->webroot;?>img/CM1_06.gif"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="10" width="11" /></td>
        </tr>
        <tr>
          <td width="12" height="100%" background="<?php echo $this->webroot;?>img/CM1_08.gif">&nbsp;</td>
          <td height="100%" colspan="2" align="center">
		  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="antiintro" style="border:#CCCCCC 1px solid;">
			 
             <tbody>
                   <tr>
                   <td>&nbsp;</td>
                 </tr>
				<tr>
				<td>
				 <table border='0' width='99%' align='center' class='Text_12_black'>
					<tr>
						<td align='left' width ='90' class='label'>Dự án :&nbsp;</td>
						<td align='left' colspan="2"><?php echo $choose['Plan']['name'];?></td>
						
						 
						<td width='100' align='center' rowspan=2>
						<div class='div-addimg'>
							<?php
								echo $this->Html->link(
								$this->Html->image('add-img.png', array('alt' => 'Add image')),
								array('controller'=>'images','action'=>'add',$gid),array('escape' => false));
								echo $this->Html->link('Thêm ảnh',array('controller'=>'images','action'=>'add'),array('class'=>'Link_Text_12_black'));
							?>

						</div>
						</td>
					</tr>
					<tr>
						<td align='left' width ='90' class='label'>Chủ thầu :&nbsp;</td>
						<td align='left' colspan="2"><?php echo $choose['Plan']['contractor'];?></td>
					</tr>
					<tr>
						<td align='left' width ='90' class='label'>Địa chỉ :&nbsp;</td>
						<td align='left' colspan="2"><?php echo $choose['Plan']['address'];?></td>
					</tr>
					<tr>
						<td align='left' width ='90' class='label'>Nội dung :&nbsp;</td>
						<td align='left' colspan="2"><?php echo $choose['Plan']['description'];?></td>
					</tr>

				</table>
                 </td>
				</tr>
                 <tr>
                   <td>&nbsp;</td>
                 </tr>
                 <tr>
                <td><!--Start Table-->
                  <div style='clear:both;border-bottom: 1px dotted #aaa;'></div>
 
						<?php echo $this->Form->create(array('name'=>'frmList' ));?>
                        <table border='0' width='99%' align='center' class="Text_12_black">
                        <tr>
                        </br>
                        <?php
                        if(empty($images)){
                            echo 'Không có ảnh nào trong thư viện này !';
                        }
                         $i=0;foreach ($images as $image){
                        
                        //debug($image);
                        $i++;?>
                        <td align='center'>
                        <a href="<?php echo $this->webroot;?>files/uploads/images/<?php echo $image['Image']['url'];?>" title="<?php echo $image['Image']['url'];?>" rel="lightbox[Brussels]">
                        <img class='img-gallery' width='100' height='80' src='<?php echo $this->webroot;?>files/uploads/images/<?php echo $image['Image']['url'];?>' border="0"/>
                        </a>                       
                        <div align="center"><?php //echo $this->Form->checkbox('chkid',array('name'=>'checkid','value'=>$image['Image']['id']))?>
                        <?php echo $this->Html->link(__('Xóa ảnh', true), array('action' => 'delete', $choose['Plan']['id'], $image['Image']['id']),array('class'=>'Link_Text_12_black'), null, sprintf(__('Bạn có chắc muốn xóa ảnh này không ?', true), $image['Image']['id'])); ?>
                        </div>
						 <div align="center"><input name="status" type="radio"  <?php if($image['Image']['status']==1){?> checked="true" <?php } ?>   value="<?php echo $image["Image"]["id"]; ?>"/><?php echo $this->Form->label(" Hiển thị trên trang chủ");?></div>
                        </td>						
                        <?php if($i==6){?>
                        </tr><tr>
                        <?php $i=0;}?>
                        <?php }?>
                        </tr>
                        </table>
                         
                        <?php echo $this->Form->end();?>
						 
                   <!--End Table--></td>
              </tr>
              <tr>
                <td height="50"><div align="right" style=" margin:8px;"><?php //echo $this->element("padding");?></div></td>
                </tr>
            </tbody>
          </table>          </td>
          <td valign="top" background="<?php echo $this->webroot;?>img/CM1_06.gif">&nbsp;</td>
        </tr>
		
        <tr>
          <td width="12"  background="<?php echo $this->webroot;?>img/CM1_08.gif"></td>
          <td align="center" valign="middle" width="637">&nbsp;</td>
          <td colspan="2" align="right"><img src="<?php echo $this->webroot;?>img/CM1_16.gif" border="0" height="23" width="22" /><img src="<?php echo $this->webroot;?>img/CM1_07.gif" border="0" height="23" width="11" /></td>
          </tr>
        <tr>
          <td width="12" style="height: 12px;"><img src="<?php echo $this->webroot;?>img/CM1_08.gif" border="0" height="30" width="12" /></td>
          <td style="height: 12px;" align="center" valign="middle" width="637"><a href="javascript:window.history.back(-1);" class="Link_Text_12_black"><img src="<?php echo $this->webroot;?>img/back.gif" align="absmiddle" border="0" /> Quay lại</a>&nbsp;<a href="#top" class="Link_Text_12_black"><img src="<?php echo $this->webroot;?>img/top.gif" align="absmiddle" border="0" /> Đầu trang</a></td>
          <td colspan="2" align="right" style="height: 12px;"><img src="<?php echo $this->webroot;?>img/CM1_10.gif" border="0" height="30" width="38" /><img src="<?php echo $this->webroot;?>img/CM1_11.gif" height="30" width="11" /></td>
          </tr>
        <tr>
          <td width="12"><img src="<?php echo $this->webroot;?>img/CM1_12.gif" height="13" width="12" /></td>
          <td background="<?php echo $this->webroot;?>img/CM1_13.gif" width="637"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="13" width="10" /></td>
          <td align="right" background="<?php echo $this->webroot;?>img/CM1_13.gif"><img src="<?php echo $this->webroot;?>img/CM1_14.gif" height="13" width="38" /></td>
          <td bgcolor="#0000FF"><img src="<?php echo $this->webroot;?>img/CM1_15.gif" height="13" width="11" /></td>
        </tr>
      </tbody>
    </table>
		</td>
         
      </tr>
</table>

<script>
  var title="Ảnh của công trình dự án";
 </script>
 <script type="text/javascript">
$('input[name=status]').mouseup(function(){
    old = $('input[name=status]:checked').val();
}).change(function(){
	news =  $('input[name=status]:checked').val();
	$.get("<?php echo $this->webroot;?>admin/images/choose/"+news+"/"+old, function(){
		alert('Lưu thành công !');
	});
})
</script>
 